From: Ivan Molodetskikh Date: Sun, 19 Mar 2023 04:45:41 +0000 (-0700) Subject: screenshot: Get cursor texture from window X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~371^2^2~75 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=237c3e958db16bb4aa2aa575085e2e249cdee67e;p=gnome-shell.git screenshot: Get cursor texture from window When a window is in the background and should not have the cursor on top of it, its _cursor will be null. By getting the texture through it, we add this extra check, which was missing before, leading to a cursor drawn at 0, 0 on windows where it should not have been drawn. Part-of: --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 59c63c71e..ecbe50bcc 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -917,6 +917,10 @@ class UIWindowSelectorWindow extends St.Button { this.insert_child_below(this._cursor, this._border); } + getCursorTexture() { + return this._cursor?.content; + } + setCursorVisible(visible) { if (!this._cursor) return; @@ -1812,7 +1816,7 @@ var ScreenshotUI = GObject.registerClass({ const texture = content.get_texture(); - let cursorTexture = this._cursor.content?.get_texture(); + let cursorTexture = window.getCursorTexture()?.get_texture(); if (!this._cursor.visible) cursorTexture = null;